package com.baosight.risk.web.page;

import com.baosight.risk.common.utils.ServletUtils;

/**
 * @author duanyongqiang
 * @date 2019.3.29
 * <p>
 * 分页返回数据类
 */
public class TableSupport {
    /**
     * 封装分页对象
     */
    public static PageDomain getPageDomain() {
        PageDomain pageDomain = new PageDomain();
        pageDomain.setPageIndex(ServletUtils.getParameterToInt("pageIndex"));
        pageDomain.setPageSize(ServletUtils.getParameterToInt("pageSize"));
        pageDomain.setSortField(ServletUtils.getParameter("sortField"));
        pageDomain.setSortOrder(ServletUtils.getParameter("sortOrder"));
        return pageDomain;
    }

    public static PageDomain buildPageRequest() {
        return getPageDomain();
    }
}
